import java.io.File;

final class OS {

  public boolean isWindows() {
    return os().contains("Win");
  }

  public boolean isMac() {
    return os().contains("Mac");
  }

  public boolean isLinux() {
    return !isWindows() || !isMac();
  }

  public File getMusicHome() {
    if (isWindows()) {
      return new File(getHomeDir(), "My Music");
    } else if (isMac()) {
      return new File(getHomeDir(), "Music");
    } else {
      return new File(getHomeDir(), "Music");
    }
  }

  public File getHomeDir() {
    String user = prop("user.name");
    if (isWindows()) {
      File[] roots = File.listRoots();
      File root = roots.length == 0 ? new File("C:/") : roots[0];
      return new File(root, "Documents and Settings/" + user);
    } else if (isMac()) {
      return new File("/Users/" + user);
    } else {
      return new File("/home/" + user);
    }
  }

  private String os() {
    return prop("os.name");
  }

  private String prop(String key) {
    return System.getProperty(key);
  }

  public static void main(String[] args) {System.getProperties().list(System.out);}
}